﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PQT.API;
using cbmobile.BLC;

namespace cbmobile
{
    public partial class SiteMaster : CommonMasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["LoginInfo"] == null)
            //    Response.Redirect("/Login.aspx");
            if (!IsPostBack)
            {
                BindUserInfo();
            }  
        }

        private int UserID
        { 
            get
            {
                return Utilis.TryParseInt(Session["ID"]);
            }
        }

        private string Name
        {
            get
            {
                if (Session["User"] != null)
                    return Session["User"].ToString();
                return "";
            }
        }


        private void BindUserInfo()
        {
            lblUserName.Text = Name;
            linkMyProfile.NavigateUrl = "RenderMain.aspx?muid=Member_Entry&UserID=" + UserID;
            linkChangePasswork.NavigateUrl = "RenderMain.aspx?muid=DoiMatKhau&UserID=" + UserID;
        }
    }
}
